/*******************************************************************************
 * Copyright 2011 Alexandre Zglav and Morphiastic
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package com.morphiastic;

public interface ElasticStoreLifecycleListener {

	/**
	 * Event fired when the global index ( or another index when we will support multiple indices )
	 * is ready
	 * 
	 * @param es
	 */
	public void onIndexCreated(ElasticStore es, String indexName);
	
	
	/**
	 * Event fired when ElasticStore is fully initialized : 
	 * 
	 * that is when index is created server side with its tokenizers, analyzers and filters defined ...
	 * 
	 * 
	 * meaning we are ready to start indexing
	 * 
	 * 
	 * @param es
	 * @param indexName
	 */
	public void onElasticStoreReady(ElasticStore es, String indexName);
	
	
	/**
	 * Fired when existing Analyzers have been loaded from the 
	 * elastic search server
	 * 
	 * @param es
	 * @param indexName
	 */
	public void onAnalyzersLoaded(ElasticStore es, String indexName);
	
	/**
	 * Fired when existing tokenizers have been loaded from the server
	 * 
	 * This can be used to add additional tokenizers definitions at startup
	 * 
	 * @param es
	 * @param indexName
	 */
	public void onTokenizersLoaded(ElasticStore es, String indexName);
	
	/**
	 * Fired when existing filters have been loaded from the server
	 * 
	 * This can be used to add additional filters definitions at startup
	 * @param es
	 * @param indexName
	 */
	public void onFiltersLoaded(ElasticStore es, String indexName);
	
	
	/**
	 * Fired when existing analysis components ( filters, tokenizsers, analyzers) 
	 * have been loaded from the ES server
	 * @param es
	 * @param indexName
	 */
	public void onAnalysisComponentsLoaded(ElasticStore es, String indexName);
	
	
	
	
}
